import type { MenuItem } from "@/types/Menu";
import { defineStore } from "pinia";

export const useMenuStore = defineStore("menu", () => {
  const menuItems = ref<MenuItem[]>([
    {
      Id: "0",
      Title: "页面",
      Icon: "mdi-cog",
      Type: "subheader",
      Value: "system",
      Children: [],
      To: "/home",
    },
    {
      Id: "1",
      Title: "系统管理",
      Icon: "mdi-cog",
      Type: "group",
      Value: "system",
      Children: [
        {
          Id: "1-1",
          Title: "用户管理",
          Icon: "mdi-account",
          Type: "group",
          Value: "user",
          Children: [
            {
              Id: "1-1-1",
              Title: "用户详情",
              Icon: "mdi-account-details",
              Type: "item",
              Value: "user-detail",
              Children: [],
              To: "/test/用户详情",
            },
          ],
        },
      ],
    },
    // 🔹 嵌套一层的菜单
    {
      Id: "2",
      Title: "内容管理",
      Icon: "mdi-folder",
      Type: "group",
      Value: "content",
      Children: [
        {
          Id: "2-1",
          Title: "文章管理",
          Icon: "mdi-file-document",
          Type: "item",
          Value: "article",
          Children: [],
          To: "/test/文章管理",
        },
      ],
    },

    // 🔹 不嵌套的菜单（3 个）
    {
      Id: "3",
      Title: "仪表盘",
      Icon: "mdi-view-dashboard",
      Type: "item",
      Value: "dashboard",
      Children: [],
      To: "/test/仪表盘",
    },
    {
      Id: "4",
      Title: "报表分析",
      Icon: "mdi-chart-line",
      Type: "item",
      Value: "report",
      Children: [],
      To: "/test/报表分析",
    },
    {
      Id: "5",
      Title: "帮助中心",
      Icon: "mdi-help-circle",
      Type: "item",
      Value: "help",
      Children: [],
      To: "/About",
    },
    {
      Id: "6",
      Title: "系统",
      Icon: "mdi-cog",
      Type: "subheader",
      Value: "systems",
      Children: [],
    },
    {
      Id: "7",
      Title: "菜单管理",
      Icon: "mdi-help-circle",
      Type: "item",
      Value: "cd",
      Children: [],
      To: "/MenuManage",
    },
  ]);
  return { menuItems };
});
